<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>后台登录</title>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/global.css">
	<style>
	body{
	background-color:#333;
	}
	#login{
		width:350px;
		margin:0 auto;
	}
	#login .form{
		float:left;
		margin-top:15px;
	}
	#errorinfo{
		float:left;
	}
	#inputLabel label{
		color:#fff;
	}
	img.logo{
		display:block;
		margin:0 auto 20px;
	}
	#login form label{
		color:#fff;
	}
	#login form input[type=text],#login form input[type=password]{
		color:#fff;
		background:transparent;
		border:none;
		outline:none;
		border-bottom:1px solid #ccc;
	}
	.submit{
		float:right;
	}
	.submit input{
		display:block;
		width:70px;
		height:70px;
		border:none;
		background-color:transparent;
		background:url(images/btn_login.png) no-repeat;
		cursor:pointer;
	}
	</style>	
</head>
  <body>
  		<img class="logo" src="<%=basePath%>images/login.png" ?/>	
	  	<div id="login" class="clearfix">
			<form action="login.action" method="post" autocomplete="off">
				<div class="form">
			    	<label>用户名：</label>
			    	<input type="text" name="username"/><br/>
			    	<label>密&nbsp;&nbsp;&nbsp;码：</label>
			    	<input type="password" name="password"/>
		    	</div>
			    <div class="submit">
			    	<input type="submit" class="button" id="loginButton" value=""/>
		    	</div>
	    	</form>
		    
		    <div id="errorinfo" class="login-header login-el" style="color:red;">
			  	<s:fielderror name="ERR"></s:fielderror>
				${requestScope.errorinfo}
		  	</div>
		  	
	    </div>
  </body>
  <SCRIPT type="text/javascript" src="<%=basePath %>/js/jquery.js" ></SCRIPT>
  <SCRIPT type="text/javascript">
  $(function(){
     $("#loginButton").click(function(){
         var flag=true;
			$("input").each(function(){
				if($.trim($(this).val())==""){
					$("#errorinfo").html("用户名和密码不能为空！");
					flag=false;
					return false;
					}
				});
			if(flag==false){
				return false;
				}
         });
	  });
  </SCRIPT>
</html>
